import { ArkMethod, Stmt } from '../../src';
import { Edge } from './Edge';

export class Node {
    private readonly attribute: string;
    private readonly fromEdges: Edge[];
    private readonly toEdges: Edge[];
    private arkMethod: ArkMethod | undefined;
    private stmt: Stmt | undefined;

    public constructor(attribute: string) {
        this.attribute = attribute;
        this.fromEdges = [];
        this.toEdges = [];
    }

    public getAttribute() {
        return this.attribute;
    }

    public getArkMethod() {
        return this.arkMethod;
    }

    public getStmt() {
        return this.stmt;
    }

    public setArkMethod(arkMethod: ArkMethod): void {
        this.arkMethod = arkMethod;
    }

    public setStmt(stmt: Stmt): void {
        this.stmt = stmt;
    }

    public getFromEdges() {
        return this.fromEdges;
    }

    public getToEdges() {
        return this.toEdges;
    }

    public addFromEdge(edge: Edge): void {
        this.fromEdges.push(edge);
    }

    public addToEdge(edge: Edge): void {
        this.toEdges.push(edge);
    }
}
